<?php

// mbilling/BillingBundle/Entity/ordersIp.php
namespace mbilling\BillingBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;

/*типы занятости:
    0)свободен
    1)служебное
    2)VPS
    3)shared
    4)dedicated
 */

/**
 * @ORM\Entity
 */
class ordersIp
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @ORM\Column(type="string", length=45)
     */
    protected $ip;
    
    /**
     * @ORM\Column(type="string", length=100, nullable="TRUE")
     */
    protected $name;
    
    /**
     * @ORM\Column(type="string", length=100, nullable="TRUE")
     */
    protected $mac;
    
    /**
     * @ORM\Column(type="integer")
     * @assert\NotBlank
     * @ipvalidation:Ip
     */
    protected $group_id;

    /**
     * @ORM\Column(type="integer", nullable="TRUE")
     */
    protected $type_id;

    /**
     * @ORM\Column(type="string", length=45, nullable="TRUE")
     */
    protected $account;

    /**
     * @ORM\Column(type="boolean")
     */
    protected $is_active;
    
    /**
     * @ORM\Column(type="boolean")
     */
    protected $for_remove;
    
    /**
     * @ORM\Column(type="integer", nullable="TRUE")
     * @assert\Type("numeric")
     */
    protected $message_id;
    
    public function __construct()
    {
        $this->setIsActive('0');
        $this->setForRemove('0');
    }
    
    public function setId($id)
    {
        $this->id = $id;
    }
    public function getId()
    {
        return $this->id;
    }

    public function setIp($ip)
    {
        $this->ip = $ip;
    }
    public function getIp()
    {
        return $this->ip;
    }
    
    public function setName($name)
    {
        $this->name = $name;
    }
    public function getName()
    {
        return $this->name;
    }
    
    public function setMac($mac)
    {
        $this->mac = $mac;
    }
    public function getMac()
    {
        return $this->mac;
    }
    
    public function setGroupId($group_id)
    {
        $this->group_id = $group_id;
    }
    public function getGroupId()
    {
        return $this->group_id;
    }

    public function setTypeId($type_id)
    {
        $this->type_id = $type_id;
    }
    public function getTypeId()
    {
        return $this->type_id;
    }

    public function setAccount($account)
    {
        $this->account = $account;
    }
    public function getAccount()
    {
        return $this->account;
    }

    public function setIsActive($is_active)
    {
        $this->is_active = $is_active;
    }
    public function getIsActive()
    {
        return $this->is_active;
    }
    
    public function setForRemove($for_remove)
    {
        $this->for_remove = $for_remove;
    }
    public function getForRemove()
    {
        return $this->for_remove;
    }
    
    public function setMessageId($message_id)
    {
        $this->message_id = $message_id;
    }
    public function getMessageId()
    {
        return $this->message_id;
    }
    
    public function initDefaultEntity()
    {
        $this->setIp('192.168.0.1');
        $this->setGroupId('1');
        $this->setTypeId('1');
        $this->setAccount('account_name');
        return $this;
    }
}
?>
